from django.shortcuts import render
from django.http import HttpResponse
from login.models import *
import json
#查询所有职务
"""
       @author: Ding Guo
       @date: 10/23/2018
       无需提交数据
       传出数据:{"职务":[xx,xx,xx]}
"""
def duty_all(request):
    all = Duty.objects.all().values_list('duty_name')
    X =[]
    for x in all:
        X.append(x[0])
    print(X)
    #return HttpResponse(json.dumps(all))
    return HttpResponse(json.dumps({'职务':X}))